Skip to content

Corrected the DB upgrade scripts #807#823

Merged
anushasunkada merged 1 commit into
mosip:developfrom
GOKULRAJ136:DB-RC-Script
Jul 3, 2026
Merged

Corrected the DB upgrade scripts #807#823
anushasunkada merged 1 commit into
mosip:developfrom
GOKULRAJ136:DB-RC-Script

Conversation

@GOKULRAJ136

@GOKULRAJ136 GOKULRAJ136 commented Jul 3, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features

    • Added support for a new upgrade path in the registration service release sequence.
    • Included a new certificate-related database field for upcoming version 1.3.0.
  • Bug Fixes

    • Cleaned up upgrade and rollback handling for version 1.2.0.2 where no database changes are needed.
    • Updated rollback steps to properly remove the new certificate field when reverting 1.3.0 changes.

Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR updates the registration version-upgrade mapping configuration in spring.properties, renaming and reordering version keys, and relocates a database schema migration (adding/dropping the CA_CERT_TYPE column) from version 1.3.0-B2 to 1.3.0, while marking 1.2.0.2 as a no-op migration.

Changes

Version Upgrade Mapping and Migration Relocation

Layer / File(s) Summary
Version-mappings configuration
registration/registration-services/src/main/resources/spring.properties
Renamed 1.2.0.1-B1 key to 1.2.0.1-SNAPSHOT, removed the 1.2.1-SNAPSHOT entry, added 1.2.0.2 and 1.3.0 mappings with incremented releaseOrder, and added documentation comments explaining releaseOrder sequencing and manifest-version detection logic.
1.2.0.2 no-op DB scripts
.../sql/1.2.0.2/initial_db_scripts.sql, .../sql/1.2.0.2/rollback_scripts.sql
Both scripts now contain only header comments stating there are no database changes for this version.
CA_CERT_TYPE migration relocation
.../sql/1.3.0/initial_db_scripts.sql, .../sql/1.3.0/rollback_scripts.sql, .../sql/1.3.0-B2/initial_db_scripts.sql(removed), .../sql/1.3.0-B2/rollback_scripts.sql(removed)
Removed the CA_CERT_TYPE column add/drop statements from the 1.3.0-B2 scripts and added the equivalent ALTER TABLE statements (add column in initial script, drop column in rollback script) to the 1.3.0 scripts.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: Prafulrakhade

Poem

A rabbit hops through version trees,
Renaming keys with practiced ease,
CA_CERT_TYPE moves down the line,
From B2 to 1.3.0, right on time. 🐰
No changes here for 1.2.0.2 —
Just a comment, nothing new!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: corrections to the database upgrade scripts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@registration/registration-services/src/main/resources/spring.properties`:
- Around line 10-15: The version-mapping entry in spring.properties must keep
every key that has ever been released, because
SoftwareUpdateHandler.executeSqlFile relies on
versionMappings.containsKey(previousVersion) to skip already-applied migrations.
Preserve the existing keys in
mosip.registration.verion.upgrade.version-mappings, especially any released
version identifiers, and if ordering needs to change update releaseOrder rather
than deleting or renaming the key so previously deployed clients still resolve
previousVersion correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: e3e6f090-ab3c-4515-bd29-f00744b5c4ad

📥 Commits

Reviewing files that changed from the base of the PR and between 3954574 and 2a75832.

📒 Files selected for processing (7)
  • registration/registration-services/src/main/resources/spring.properties
  • registration/registration-services/src/main/resources/sql/1.2.0.2/initial_db_scripts.sql
  • registration/registration-services/src/main/resources/sql/1.2.0.2/rollback_scripts.sql
  • registration/registration-services/src/main/resources/sql/1.3.0-B2/initial_db_scripts.sql
  • registration/registration-services/src/main/resources/sql/1.3.0-B2/rollback_scripts.sql
  • registration/registration-services/src/main/resources/sql/1.3.0/initial_db_scripts.sql
  • registration/registration-services/src/main/resources/sql/1.3.0/rollback_scripts.sql
💤 Files with no reviewable changes (2)
  • registration/registration-services/src/main/resources/sql/1.3.0-B2/rollback_scripts.sql
  • registration/registration-services/src/main/resources/sql/1.3.0-B2/initial_db_scripts.sql

@anushasunkada anushasunkada merged commit 46ca453 into mosip:develop Jul 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants